import request from "@/utils/request"

//添加公式
export const addFormulaApi = (param) => {
    return request.post('/formula/', param)
}

//编辑公式
export const editFormulaApi = (param) => {
    return request.patch('/formula/', param)
}
//获取公式
export const getFormulaApi = (company_id) => {
    return request.get(`/formula/?company_id=${company_id}`)
}
//删除公式
export const delFormulaApi = (param) => {
    // 使用 `data` 字段传递请求体中的 `id`
    return request.delete('/formula/', {
        data: { id: param.id }  // 传递 `id` 到请求体
    });
}

//计算公式
export const computeFormulaApi = (data) => {
    return request.get('/formula/view', {
        params: data
    })
}